package com.four.dailymanage.pic.controller;

import com.four.dailymanage.pic.utils.MinioUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@CrossOrigin
@RestController
public class UploadController {
    @Autowired
    private MinioUtils minioUtils;
    @PostMapping("/upload")
    public String upload(MultipartFile file){
        String url= minioUtils.upload(file);
        return url;
    }
}
